#include <bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while(t--)
	{
		int n;
		cin >> n;
		cout << 2*n-3 << " ";
		for(int i=1;i<=2*n-2;i++)
		{
			if(i%2==1)
			{
				cout << 2 << " ";
			}
			else if(i%2==0)
			{
				cout << -1 << " ";
			}
		}
		cout << 1 << endl; 
	}
	return 0;
}
